<template>
  <div>
    <el-container style="height: 500px; border: 1px solid #eee">
      <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
        <el-menu :default-openeds="['1', '2']">
          <el-submenu index="1">
            <template slot="title"><i class="el-icon-message"></i>个人主页</template>
            <el-menu-item-group>
              <!--            <template slot="title">欢迎页面</template>-->
              <el-menu-item index="1-1" @click="info">个人信息</el-menu-item>
              <el-menu-item index="1-2" @click="modifyInfo">修改信息</el-menu-item>
            </el-menu-item-group>

          </el-submenu>
          <el-submenu index="2">
            <template slot="title"><i class="el-icon-menu"></i>宿舍服务</template>
            <el-menu-item-group>
              <!--            <template slot="title">空宿舍查询</template>-->
              <el-menu-item index="2-1" @click="queryDorm">空宿舍查询</el-menu-item>
              <el-menu-item index="2-2" @click="selectDorm">在线抢宿舍</el-menu-item>
              <el-menu-item index="2-3" @click="result">选宿舍结果</el-menu-item>
              <!--            <el-menu-item index="2-2">选项2</el-menu-item>-->
            </el-menu-item-group>
          </el-submenu>
        </el-menu>
      </el-aside>

      <el-container>
        <el-header style="text-align: right; font-size: 12px">
          <el-dropdown>
            <i class="el-icon-setting" style="margin-right: 15px"></i>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item>查看</el-dropdown-item>
              <el-dropdown-item>新增</el-dropdown-item>
              <el-dropdown-item>删除</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
          <span>{{ this.$route.params.username }}</span>
        </el-header>

        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  name: "Welcome",
  data() {
    return {}
  },
  methods: {
    info: function () {
      this.$router.push("/home/info")
    },

    modifyInfo() {
      this.$router.push("/home/modifyInfo")
    },

    queryDorm() {
      this.$router.push("/home/queryDorm")
    },

    selectDorm() {
      this.$router.push("/home/selectDorm")
    },

    result() {
      this.$router.push("/home/result")
    },
  },
  computed: {},
  watch: {},
}
</script>

<style scoped>

</style>